package com.aaa.behind.service.impl;

import com.aaa.entity.TbZone;
import com.aaa.behind.dao.TbZoneMapper;
import com.aaa.behind.service.ITbZoneService;
import com.aaa.util.PageInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 专区 服务实现类
 * </p>
 *
 * @author whj
 * @since 2023-02-01
 */
@Service
public class TbZoneServiceImpl extends ServiceImpl<TbZoneMapper, TbZone> implements ITbZoneService {

    @Override
    public Page fuzzySearch(PageInfo pageInfo, TbZone tbZone) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (tbZone.getZoneName() != null){
            queryWrapper.like("zone_name",tbZone.getZoneName());
        }
        if (tbZone.getIsDisable() != null){
            queryWrapper.eq("is_disable",tbZone.getIsDisable());
        }
        return this.page(pageInfo,queryWrapper);
    }
}
